home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / OCETemplates.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  88.5 KB  |  1,846 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        OCETemplates.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Templates Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __OCETEMPLATES__
  18. #define __OCETEMPLATES__
  19.  
  20. #ifndef REZ
  21. #ifndef __MACTYPES__
  22.     #include <MacTypes.h>
  23. #endif
  24.  
  25. #ifndef __EVENTS__
  26.     #include <Events.h>
  27. #endif
  28.  
  29.  
  30. #endif /* REZ */
  31. #ifndef __OCE__
  32.     #include <OCE.h>
  33. #endif
  34.  
  35.  
  36. #ifndef REZ
  37. #ifndef __OCESTANDARDMAIL__
  38.     #include <OCEStandardMail.h>
  39. #endif
  40.  
  41.  
  42.  
  43.  
  44. #if PRAGMA_ONCE
  45. #pragma once
  46. #endif
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. #if PRAGMA_IMPORT
  53. #pragma import on
  54. #endif
  55.  
  56. #if PRAGMA_STRUCT_ALIGN
  57.     #pragma options align=mac68k
  58. #elif PRAGMA_STRUCT_PACKPUSH
  59.     #pragma pack(push, 2)
  60. #elif PRAGMA_STRUCT_PACK
  61.     #pragma pack(2)
  62. #endif
  63.  
  64. #endif /* REZ */
  65.  
  66.  
  67. /************************************************************************************************
  68.  ********************************* Template Resource Constants: *********************************
  69.  ************************************************************************************************/
  70.  
  71.  
  72. /* Current versions of all the different template types: */
  73.  
  74. #define kDETAspectVersion        -976
  75. #define kDETInfoPageVersion        -976
  76. #define kDETKillerVersion        -976
  77. #define kDETForwarderVersion    -976
  78. #define kDETFileTypeVersion        -976
  79.  
  80.  
  81. /*    'Normal' separation for template IDs within the file (this is just a suggestion; you can use whatever
  82.     separation you like, so long as two separate templates don't have overlapping resources): */
  83. #define kDETIDSep 250
  84.  
  85. /* A few predefined base IDs (again, just suggestions): */
  86. #define kDETFirstID        (1000)
  87. #define kDETSecondID    (1000+kDETIDSep)
  88. #define kDETThirdID        (1000+2*kDETIDSep)
  89. #define kDETFourthID    (1000+3*kDETIDSep)
  90. #define kDETFifthID        (1000+4*kDETIDSep)
  91.  
  92.  
  93.  
  94. /*    Templates consist of a set of associated resources, at constant offsets from a 'base ID' set by the
  95.     signature resource of the template. In the case of aspect templates, most of the resources in the
  96.     template are accessible from the template as property default values. The property number is the same
  97.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  98.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. 
  99.     
  100.     All templates include the following resource fork resources:
  101.  
  102.      Type    Offset                        Description
  103.      ----    ------                        -----------
  104.     'rstr'    kDETTemplateName            Contains the name of the template
  105.  
  106. */
  107.  
  108. #define kDETTemplateName 0
  109.  
  110. /*    Aspects, info-pages, and forwarders include the following as well:
  111.  
  112.      Type    Offset                        Description
  113.      ----    ------                        -----------
  114.     'rstr'    kDETRecordType                Contains the type of record this applies to
  115.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  116.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  117.  
  118. */
  119.  
  120. #define kDETRecordType                1
  121. #define kDETAttributeType            2
  122. #define kDETAttributeValueTag        3
  123.  
  124.  
  125.  
  126. /* ************************************ Aspects */
  127.  
  128. /*    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  129.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  130.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  131.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  132.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  133.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  134.     'detb' corresponds to kDETPrTypeBinary.
  135.  
  136.  
  137.  
  138.      Type    Offset                        Description
  139.      ----    ------                        -----------
  140.     'deta'    0                            Identifies the type of resource
  141.     'detc'    kDETCode                    Is the code resource, if any is used
  142.     'ICN#'    kDETAspectMainBitmap
  143.     'icl8'    kDETAspectMainBitmap
  144.     'icl4'    kDETAspectMainBitmap
  145.     'ics#'    kDETAspectMainBitmap
  146.     'ics8'    kDETAspectMainBitmap
  147.     'ics4'    kDETAspectMainBitmap
  148.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  149.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  150.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  151.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  152.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  153.                                         another template; if no other template provides an external name for a given internal
  154.                                         category, the internal name is used as the external name (main aspect only)
  155.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  156.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  157.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  158.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  159.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  160.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  161.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  162.                                         property # times 2 is used as an index into this array; if the item is not editable,
  163.                                         then the property # times 2 plus 1 is used
  164.  
  165.  
  166.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  167.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  168.                                         is used in a selection dialog invoked by an 'Add...' button
  169.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  170.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  171.                                         is the tag; the rest is the attribute value contents
  172.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  173.                                         from a code resource, or via a default value in a resource)
  174.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  175.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  176.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like 'add' or 'drop'; if
  177.                                         there's any doubt, use 'OK')
  178.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  179.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  180.                                         can be dragged into this aspect, and the second is the attribute type to store
  181.                                         the reference in
  182.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  183.                                         category of records which can be dragged in, and the second is the type of
  184.                                         attribute to place the alias in
  185.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  186.                                         dragged from (or '' for any), the second is the attribute type which can be dragged
  187.                                         in, and the third is the attribute type to store the new attribute in
  188.  
  189.  
  190.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  191.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  192.                                         everything can be dragged out)
  193.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  194.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  195.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  196.                                             page-selector (main aspect only)
  197.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  198. */
  199.  
  200.  
  201. #define kDETAspectCode                     4
  202. #define kDETAspectMainBitmap             5
  203. #define kDETAspectName                     6
  204. #define kDETAspectCategory                 7
  205. #define kDETAspectExternalCategory         8
  206. #define kDETAspectKind                     9
  207. #define kDETAspectGender                10
  208. #define kDETAspectWhatIs                11
  209. #define kDETAspectAliasKind                12
  210. #define kDETAspectAliasGender            13
  211. #define kDETAspectAliasWhatIs            14
  212. #define kDETAspectBalloons                15
  213. #define kDETAspectNewMenuName            16
  214. #define kDETAspectNewEntryName            17
  215. #define kDETAspectNewValue                18
  216. #define kDETAspectSublistOpenOnNew        19
  217. #define kDETAspectLookup                20
  218. #define kDETAspectDragInString            21
  219. #define kDETAspectDragInVerb            22
  220. #define kDETAspectDragInSummary            23
  221. #define kDETAspectRecordDragIn            24
  222. #define kDETAspectRecordCatDragIn        25
  223. #define kDETAspectAttrDragIn            26
  224. #define kDETAspectAttrDragOut            27
  225. #define kDETAspectViewMenu                28
  226. #define kDETAspectReverseSort            29
  227. #define kDETAspectInfoPageCustomWindow    30
  228.  
  229.  
  230.  
  231. /* Properties: */
  232.  
  233. #define kDETNoProperty                -1
  234.  
  235. /* Each aspect has 250 attribute properties in this range: */
  236. #define kDETFirstLocalProperty        0
  237. #define kDETLastLocalProperty         (kDETFirstLocalProperty+249)
  238.  
  239. /* Developers should use property numbers starting at this point: */
  240. #define kDETFirstDevProperty        40
  241.  
  242. /* The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  243.    given by kDETFirstConstantProperty+n): */
  244. #define kDETFirstConstantProperty    250
  245. #define kDETLastConstantProperty    (kDETFirstConstantProperty+249)
  246.  
  247. /* To convert a number into a constant property, add this: */
  248. #define kDETConstantProperty        kDETFirstConstantProperty
  249.  
  250. #define kDETZeroProperty            (kDETConstantProperty+0)
  251. #define kDETOneProperty                (kDETConstantProperty+1)
  252. #define kDETFalseProperty            (kDETConstantProperty+0)
  253. #define kDETTrueProperty            (kDETConstantProperty+1)
  254.  
  255. /* The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: */
  256. #define kDETPrName                     3050
  257. #define kDETPrKind                     3051
  258.  
  259. /* Access mask properties: */
  260. #define kDETDNodeAccessMask            25825    /* The DNode access mask */
  261. #define kDETRecordAccessMask        25826    /* The record access mask */
  262. #define kDETAttributeAccessMask        25827    /* The attribute access mask */
  263. #define kDETPrimaryMaskByBit        25828    /* A set of sixteen properties to access all bits of the primary mask */
  264.  
  265.  
  266.  
  267. /* See AOCE documentation for details definitions of each of these bits: */
  268. #define kDETPrimarySeeMask            kDETPrimaryMaskByBit
  269. #define kDETPrimaryAddMask            (kDETPrimaryMaskByBit+1)
  270. #define kDETPrimaryDeleteMask        (kDETPrimaryMaskByBit+2)
  271. #define kDETPrimaryChangeMask        (kDETPrimaryMaskByBit+3)
  272. #define kDETPrimaryRenameMask        (kDETPrimaryMaskByBit+4)
  273. #define kDETPrimaryChangePrivsMask    (kDETPrimaryMaskByBit+5)
  274. #define kDETPrimaryTopMaskBit        (kDETPrimaryMaskByBit+15)
  275.  
  276. /* The following property is zero until we've completed the first catalog lookup; from then on it's 1 */
  277. #define kDETPastFirstLookup            26550
  278.  
  279. /* The following property is the page number; issuing a property command with this property will flip info-pages */
  280. #define kDETInfoPageNumber            27050
  281.  
  282. /* The value of the following properties contains the template number of the targeted aspect's template, and the
  283.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  284.    target selectors. */
  285. #define kDETAspectTemplateNumber    26551
  286. #define kDETInfoPageTemplateNumber    26552
  287.  
  288. /* Properties for property commands to deal with sublist items: */
  289. #define kDETOpenSelectedItems        26553    /* Open selected sublist items */
  290. #define kDETAddNewItem                26554    /* Add new sublist item */
  291. #define kDETRemoveSelectedItems        26555    /* Remove selected sublist items */
  292.  
  293. /* Property types are used to specify types of properties and conversions between types (zero and negative numbers
  294.    are reserved for Apple; developer code resources can use positive numbers): */
  295. #define kDETPrTypeNumber            -1    /* A number */
  296. #define kDETPrTypeString            -2    /* A string */
  297. #define kDETPrTypeBinary            -3    /* A binary block */
  298.  
  299. /* Rez-compatible tag definitions (These are the same as in OCE.h, but they're enums there and can't be rezed•••) */
  300. #ifdef REZ
  301. #define typeRString            'rstr'
  302. #define typePackedDSSpec    'dspc'
  303. #define typeBinary            'bnry'
  304. #endif
  305.  
  306.  
  307.  
  308. /* ************************************ Info-pages */
  309.  
  310. /* Info-pages include the following as well:
  311.  
  312.      Type    Offset                        Description
  313.      ----    ------                        -----------
  314.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  315.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  316.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  317.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ('Catalogs' if not present)
  318.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  319.  
  320. */
  321.  
  322. #define kDETInfoPageName            4
  323. #define kDETInfoPageMainViewAspect    5
  324. #define kDETInfoPageMenuName        6
  325. #define kDETInfoPageMenuEntries        7
  326.  
  327.  
  328.  
  329.  
  330. /* ************************************ Views 
  331.  
  332.    Flags: */
  333.  
  334. #define kDETNoFlags                        0
  335. #define kDETEnabled                        (1 << 0)    /* Main view (non-sublist) field enabled */
  336.  
  337. /* The following flags make sense for items in a sublist only */
  338. #define kDETHilightIfSelected            (1 << 0)    /* Hilight view when entry is selected */
  339.  
  340. /* The following flags make sense for text views only */
  341. #define kDETNumericOnly                    (1 << 3)    /* Only allow the user to enter digits */
  342. #define kDETMultiLine                    (1 << 4)    /* Allow multiple lines in view */
  343. #define kDETDynamicSize                    (1 << 9)    /* Don't draw box around text until user clicks in it, then auto-size it */
  344. #define kDETAllowNoColons                (1 << 10)    /* Don't allow the user to enter colons (convert ':'s to '-'s) */
  345.  
  346. /* The following flags are used for pop-up menus only */
  347. #define kDETPopupDynamicSize            (1 << 8)    /* Automatically resize pop-up based on contents */
  348.  
  349. /* The following flags are used for EditPicture views only */
  350. #define kDETScaleToView                    (1 << 8)    /* Scale picture to view bounds rather than cropping */
  351.  
  352. /*    Sizes for icons */
  353. #define kDETLargeIcon        0
  354. #define kDETSmallIcon        1
  355. #define kDETMiniIcon        2
  356.  
  357. /* Stolen from TextEdit.h */
  358. #define kDETLeft          0
  359. #define kDETCenter          1
  360. #define kDETRight         -1
  361. #define kDETForceLeft    -2
  362.  
  363.  
  364.  
  365. /* Flags for use within Box view type attributes - these are distinct from the flags above */
  366.  
  367. #define    kDETUnused                    0
  368. #define kDETBoxTakesContentClicks    (1 << 0)
  369. #define kDETBoxIsRounded            (1 << 1)
  370. #define kDETBoxIsGrayed                (1 << 2)
  371. #define kDETBoxIsInvisible            (1 << 3)
  372.  
  373. /* The common font info */
  374.  
  375. #define kDETApplicationFont                 1
  376. #define kDETApplicationFontSize          9
  377. #define kDETAppFontLineHeight            12
  378.  
  379. #define kDETSystemFont                     0
  380. #define kDETSystemFontSize                12
  381. #define kDETSystemFontLineHeight        16
  382.  
  383. #define kDETDefaultFont                     1
  384. #define kDETDefaultFontSize                 9
  385. #define kDETDefaultFontLineHeight        12
  386.  
  387. /*    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): */
  388. #define kDETNormal                        0
  389. #define kDETBold                        1
  390. #define kDETItalic                        2
  391. #define kDETUnderline                    4
  392. #define kDETOutline                        8
  393. #define kDETShadow                     0x10
  394. #define kDETCondense                 0x20
  395. #define kDETExtend                     0x40
  396.  
  397. #define kDETIconStyle                   -3    /* Normal text style for regular sublist entries, italic text style for aliases */
  398.  
  399. /* View menu: */
  400.  
  401. #define    kDETChangeViewCommand        'view'    /* Change the view; used especially in StaticCommandTextFromView sublist headers */
  402.  
  403.  
  404. /* Info-page window sizes: */
  405.  
  406. /* Default record info-pages: */
  407. #define kDETRecordInfoWindHeight        228
  408. #define kDETRecordInfoWindWidth            400
  409.  
  410. /* Default attribute info-pages: */
  411. #define kDETAttributeInfoWindHeight        250
  412. #define kDETAttributeInfoWindWidth        230
  413.  
  414. /* Page identifying icon (for default info-page layout): */
  415. #define kDETSubpageIconTop        8
  416. #define kDETSubpageIconLeft        8
  417. #define kDETSubpageIconBottom    (kDETSubpageIconTop+32)
  418. #define kDETSubpageIconRight    (kDETSubpageIconLeft+32)
  419. #define kDETSubpageIconRect        {kDETSubpageIconTop, kDETSubpageIconLeft, kDETSubpageIconBottom, kDETSubpageIconRight}
  420.  
  421. /* The following rectangle can be used in a 'deti' with no sublist: */
  422. #define kDETNoSublistRect        {0, 0, 0, 0}
  423.  
  424.  
  425.  
  426.  
  427. /* ************************************ Killers 
  428.  
  429.    Killers include the following as well:
  430.  
  431.      Type    Offset                        Description
  432.      ----    ------                        -----------
  433.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  434.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  435.  
  436. */
  437.  
  438. #define kDETKillerName 1
  439.  
  440.  
  441. /* ************************************ Forwarders 
  442.  
  443.    Forwarders include the following as well:
  444.  
  445.      Type    Offset                        Description
  446.      ----    ------                        -----------
  447.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  448.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  449.  
  450. */
  451.  
  452. #define kDETForwarderTemplateNames    4
  453.  
  454.  
  455.  
  456. /*********************************************************************************** 
  457.  ********************************* Categories: ************************************* 
  458.  *********************************************************************************** 
  459.  
  460.    Internal category names: */
  461.  
  462. #define kDETCategoryAllItems        "aoce All Items"        /* Everything in or out of a category */
  463. #define kDETCategoryAddressItems    "aoce Address Items"    /* Anything that can be used to address something */
  464. #define kDETCategoryMisc            "aoce Miscellaneous"    /* Things that don't deserve their own category */
  465.  
  466.  
  467.  
  468. /***********************************************************************************/
  469. /********************************* Code Resources: *********************************/
  470. /***********************************************************************************/
  471. #ifndef REZ
  472. /* Target specification: */
  473. enum {
  474.     kDETSelf                    = 0,                            /* The "current" item */
  475.     kDETSelfOtherAspect            = 1,                            /* Another aspect of the current item */
  476.     kDETParent                    = 2,                            /* The parent (i.e., the aspect we're in the sublist of, if any) of the current item */
  477.     kDETSublistItem                = 3,                            /* The itemNumberth item in the sublist */
  478.     kDETSelectedSublistItem        = 4,                            /* The itemNumberth selected item in the sublist */
  479.     kDETDSSpec                    = 5,                            /* The item specified by the packed DSSpec */
  480.     kDETAspectTemplate            = 6,                            /* A specific aspect template (number itemNumber) */
  481.     kDETInfoPageTemplate        = 7,                            /* A specific info-page template (number itemNumber) * Force type to be short */
  482.     kDETHighSelector            = 0xF000
  483. };
  484.  
  485. typedef long                             DETTargetSelector;
  486.  
  487. struct DETTargetSpecification {
  488.     DETTargetSelector                 selector;                    /* Target selection method (see above) */
  489.     RStringPtr                         aspectName;                    /* The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,*/
  490.                                                                 /*   kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none; */
  491.                                                                 /*  always filled in for calls if there is an aspect, even if it's the main aspect */
  492.     long                             itemNumber;                    /* Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);*/
  493.                                                                 /*   1-based indexing */
  494.     PackedDSSpecPtr                 dsSpec;                        /* DSSpec (kDETDSSpec only) */
  495. };
  496. typedef struct DETTargetSpecification    DETTargetSpecification;
  497. /* Code resource calls and call-backs both return an OSType:
  498.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  499.         noErr                    = function completed successfully
  500.         any error                = function failed, and here's why
  501. */
  502. #define kDETDidNotHandle 1
  503. /* Call-back functions:
  504.  
  505.         reqFunction                            Action
  506.         -----------                            ------
  507.         kDETcmdBeep                            Call SysBeep; useful for testing that a code resource's calls/call-backs are working at all
  508.  
  509.         kDETcmdBusy                            Put up watch cursor and switch processes; user events elicit a beep
  510.  
  511.         kDETcmdChangeCallFors                Change call-fors mask
  512.  
  513.         kDETcmdGetCommandSelectionCount        Get the command selection count (for calls which have a command selection list)
  514.         kDETcmdGetCommandItemN                Get command selection item n (for calls which have a command selection list)
  515.  
  516.         kDETcmdOpenDSSpec                    PackedDSSpec open (can also be done via AppleEvents -- this is a short-cut)
  517.  
  518.         kDETcmdAboutToTalk                    About to talk to user: bring us to front, disable watch cursor, etc.
  519.  
  520.         kDETcmdUnloadTemplates                Flush templates
  521.  
  522.         kDETcmdTemplateCounts                Return number of aspect and info-page templates in system
  523.  
  524.         kDETcmdGetDSSpec                    Get the PackedDSSpec for this object
  525.  
  526.         kDETcmdSublistCount                    Return the count of the sublist items
  527.         kDETcmdSelectedSublistCount            Return the count of the selected sublist items
  528.  
  529.         kDETcmdRequestSync                    Request a sync-up of the aspect with the catalog
  530.  
  531.         kDETcmdBreakAttribute                Break an attribute -- apply all applicable patterns to an attribute to generate properties
  532.  
  533.         kDETcmdGetTemplateFSSpec            Get the FSSpec of the file containing the template
  534.  
  535.         kDETcmdGetOpenEdit                    Return the property of the view being edited (or kDETNoProperty if none)
  536.         kDETcmdCloseEdit                    Close the current edit
  537.  
  538.         kDETcmdGetPropertyType                Get a property type
  539.  
  540.         kDETcmdGetPropertyNumber            Get a property, number format
  541.         kDETcmdGetPropertyRString            Get a property, RString format
  542.         kDETcmdGetPropertyBinarySize        Get a property, binary, return size
  543.         kDETcmdGetPropertyBinary            Get a property, binary format
  544.  
  545.         kDETcmdGetPropertyChanged            Get a property changed flag
  546.         kDETcmdGetPropertyEditable            Get a property editable flag
  547.  
  548.         kDETcmdSetPropertyType                Set a property type
  549.  
  550.         kDETcmdSetPropertyNumber            Set a property, number format
  551.         kDETcmdSetPropertyRString            Set a property, RString format
  552.         kDETcmdSetPropertyBinary            Set a property, binary data & size
  553.  
  554.         kDETcmdSetPropertyChanged            Set a property changed flag
  555.         kDETcmdSetPropertyEditable            Set a property editable flag
  556.  
  557.         kDETcmdDirtyProperty                Dirty a property (notify other code resources of change)
  558.  
  559.         kDETcmdDoPropertyCommand            Issue a property command
  560.  
  561.         kDETcmdAddMenu                        Add to the end of a dynamic menu
  562.         kDETcmdRemoveMenu                    Remove a dynamic menu item
  563.         kDETcmdMenuItemRString                Get a dynamic menu item RString
  564.  
  565.         kDETcmdSaveProperty                    Force a save of a property -- apply all applicable patterns to write out the property
  566.  
  567.         kDETcmdGetCustomViewUserReference    Get custom view user reference (as given in .r file)
  568.         kDETcmdGetCustomViewBounds            Get custom view current bounds
  569.  
  570.         kDETcmdGetResource                    Get a resource from a template
  571. */
  572.  
  573. enum {
  574.     kDETcmdSimpleCallback        = 0,
  575.     kDETcmdBeep                    = 1,
  576.     kDETcmdBusy                    = 2,
  577.     kDETcmdChangeCallFors        = 3,
  578.     kDETcmdGetCommandSelectionCount = 4,
  579.     kDETcmdGetCommandItemN        = 5,
  580.     kDETcmdOpenDSSpec            = 6,
  581.     kDETcmdAboutToTalk            = 7,
  582.     kDETcmdUnloadTemplates        = 8,
  583.     kDETcmdTemplateCounts        = 9,
  584.     kDETcmdTargetedCallback        = 1000,
  585.     kDETcmdGetDSSpec            = 1001,
  586.     kDETcmdSublistCount            = 1002,
  587.     kDETcmdSelectedSublistCount    = 1003,
  588.     kDETcmdRequestSync            = 1004,
  589.     kDETcmdBreakAttribute        = 1005,
  590.     kDETcmdGetTemplateFSSpec    = 1006,
  591.     kDETcmdGetOpenEdit            = 1007,
  592.     kDETcmdCloseEdit            = 1008,
  593.     kDETcmdPropertyCallback        = 2000,
  594.     kDETcmdGetPropertyType        = 2001,
  595.     kDETcmdGetPropertyNumber    = 2002,
  596.     kDETcmdGetPropertyRString    = 2003,
  597.     kDETcmdGetPropertyBinarySize = 2004,
  598.     kDETcmdGetPropertyBinary    = 2005,
  599.     kDETcmdGetPropertyChanged    = 2006,
  600.     kDETcmdGetPropertyEditable    = 2007,
  601.     kDETcmdSetPropertyType        = 2008,
  602.     kDETcmdSetPropertyNumber    = 2009,
  603.     kDETcmdSetPropertyRString    = 2010,
  604.     kDETcmdSetPropertyBinary    = 2011,
  605.     kDETcmdSetPropertyChanged    = 2012,
  606.     kDETcmdSetPropertyEditable    = 2013,
  607.     kDETcmdDirtyProperty        = 2014,
  608.     kDETcmdDoPropertyCommand    = 2015,
  609.     kDETcmdAddMenu                = 2016,
  610.     kDETcmdRemoveMenu            = 2017,
  611.     kDETcmdMenuItemRString        = 2018,
  612.     kDETcmdSaveProperty            = 2019,
  613.     kDETcmdGetCustomViewUserReference = 2020,
  614.     kDETcmdGetCustomViewBounds    = 2021,
  615.     kDETcmdGetResource            = 2022,                            /* Force type to be long */
  616.     kDETcmdHighCallback            = (long)0xF0000000
  617. };
  618.  
  619.  
  620. typedef unsigned long                     DETCallBackFunctions;
  621. /* Call functions:
  622.  
  623.         reqFunction                        Action
  624.         -----------                        ------
  625.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  626.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  627.  
  628.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  629.                                         the value that's about to be created; sent to the template that will be used for
  630.                                         the main aspect of the new entry
  631.  
  632.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  633.  
  634.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  635.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  636.  
  637.         kDETcmdIdle                        Called periodically during idle times
  638.  
  639.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  640.  
  641.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  642.  
  643.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  644.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  645.  
  646.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  647.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  648.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  649.                                         main aspect of the attribute that's about to be deleted
  650.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  651.  
  652.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  653.  
  654.         kDETcmdDynamicResource            Return a dynamically created resource
  655.  
  656.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  657.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  658.  
  659.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  660.  
  661.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  662.  
  663.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  664.  
  665.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  666.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  667.  
  668.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  669.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  670.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  671.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  672.  
  673.         kDETcmdCustomViewDraw            Custom view draw
  674.         kDETcmdCustomViewMouseDown        Custom view mouse down
  675.  
  676.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  677.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  678.  
  679.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  680.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  681. */
  682.  
  683. enum {
  684.     kDETcmdSimpleCall            = 0,
  685.     kDETcmdInit                    = 1,
  686.     kDETcmdExit                    = 2,
  687.     kDETcmdAttributeCreation    = 3,
  688.     kDETcmdDynamicForwarders    = 4,
  689.     kDETcmdTargetedCall            = 1000,
  690.     kDETcmdInstanceInit            = 1001,
  691.     kDETcmdInstanceExit            = 1002,
  692.     kDETcmdIdle                    = 1003,
  693.     kDETcmdViewListChanged        = 1004,
  694.     kDETcmdValidateSave            = 1005,
  695.     kDETcmdDropQuery            = 1006,
  696.     kDETcmdDropMeQuery            = 1007,
  697.     kDETcmdAttributeNew            = 1008,
  698.     kDETcmdAttributeChange        = 1009,
  699.     kDETcmdAttributeDelete        = 1010,
  700.     kDETcmdItemNew                = 1011,
  701.     kDETcmdOpenSelf                = 1012,
  702.     kDETcmdDynamicResource        = 1013,
  703.     kDETcmdShouldSync            = 1014,
  704.     kDETcmdDoSync                = 1015,
  705.     kDETcmdPropertyCall            = 2000,
  706.     kDETcmdPropertyCommand        = 2001,
  707.     kDETcmdMaximumTextLength    = 2002,
  708.     kDETcmdPropertyDirtied        = 2003,
  709.     kDETcmdPatternIn            = 2004,
  710.     kDETcmdPatternOut            = 2005,
  711.     kDETcmdConvertToNumber        = 2006,
  712.     kDETcmdConvertToRString        = 2007,
  713.     kDETcmdConvertFromNumber    = 2008,
  714.     kDETcmdConvertFromRString    = 2009,
  715.     kDETcmdCustomViewDraw        = 2010,
  716.     kDETcmdCustomViewMouseDown    = 2011,
  717.     kDETcmdKeyPress                = 2012,
  718.     kDETcmdPaste                = 2013,
  719.     kDETcmdCustomMenuSelected    = 2014,
  720.     kDETcmdCustomMenuEnabled    = 2015,
  721.     kDETcmdHighCall                = (long)0xF0000000                /* Force the type to be long */
  722. };
  723.  
  724. typedef unsigned long                     DETCallFunctions;
  725. /* Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): */
  726. enum {
  727.     kDETDoNothing                = FOUR_CHAR_CODE('xxx0'),
  728.     kDETMove                    = FOUR_CHAR_CODE('move'),
  729.     kDETDrag                    = FOUR_CHAR_CODE('drag'),
  730.     kDETAlias                    = FOUR_CHAR_CODE('alis')
  731. };
  732.  
  733.  
  734.  
  735. struct DETProtoCallBackBlock {
  736.     DETCallBackFunctions             reqFunction;                /* Requested function */
  737.     DETTargetSpecification             target;                        /* The target for the request */
  738.     short                             property;                    /* The property to apply the request to */
  739. };
  740. typedef struct DETProtoCallBackBlock    DETProtoCallBackBlock;
  741.  
  742. struct DETBeepBlock {
  743.     DETCallBackFunctions             reqFunction;                /* Requested function */
  744. };
  745. typedef struct DETBeepBlock                DETBeepBlock;
  746.  
  747. struct DETBusyBlock {
  748.     DETCallBackFunctions             reqFunction;                /* Requested function */
  749. };
  750. typedef struct DETBusyBlock                DETBusyBlock;
  751.  
  752. struct DETChangeCallForsBlock {
  753.     DETCallBackFunctions             reqFunction;                /* Requested function */
  754.     DETTargetSpecification             target;                        /* The target for the request */
  755.     long                             newCallFors;                /*  -> New call-for mask */
  756. };
  757. typedef struct DETChangeCallForsBlock    DETChangeCallForsBlock;
  758.  
  759. struct DETGetCommandSelectionCountBlock {
  760.     DETCallBackFunctions             reqFunction;                /* Requested function */
  761.     long                             count;                        /* <-  The number of items in the command selection list */
  762. };
  763. typedef struct DETGetCommandSelectionCountBlock DETGetCommandSelectionCountBlock;
  764. enum {
  765.     kDETHFSType                    = 0,                            /* HFS item type */
  766.     kDETDSType                    = 1,                            /* Catalog Service item type */
  767.     kDETMailType                = 2,                            /* Mail (letter) item type */
  768.     kDETMoverType                = 3,                            /* Sounds, fonts, etc., from inside a suitcase or system file */
  769.     kDETLastItemType            = (long)0xF0000000                /* Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) */
  770. };
  771.  
  772.  
  773. typedef unsigned long                     DETItemType;
  774. /* FSSpec plus possibly interesting additional info */
  775.  
  776. struct DETFSInfo {
  777.     OSType                             fileType;                    /* File type */
  778.     OSType                             fileCreator;                /* File creator */
  779.     unsigned short                     fdFlags;                    /* Finder flags */
  780.     FSSpec                             fsSpec;                        /* FSSpec */
  781. };
  782. typedef struct DETFSInfo                DETFSInfo;
  783.  
  784. struct DSRec {
  785.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  786.     short                             refNum;                        /* <-  Refnum for returned address */
  787.     AuthIdentity                     identity;                    /* <-  Identity for returned address */
  788. };
  789. typedef struct DSRec                    DSRec;
  790.  
  791. union ItemRec {
  792.     DETFSInfo **                    fsInfo;                        /* <-  FSSpec & info for item (caller must DisposHandle() when done) */
  793.     DSRec                             ds;
  794.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  795.     LetterSpec **                    ltrSpec;                    /* <-  Letter spec for item (caller must DisposHandle() when done) */
  796. };
  797. typedef union ItemRec                    ItemRec;
  798.  
  799. struct DETGetCommandItemNBlock {
  800.     DETCallBackFunctions             reqFunction;                /* Requested function */
  801.     long                             itemNumber;                    /*  -> Item number to retrieve (1-based) */
  802.     DETItemType                     itemType;                    /*  -> Type of item to be returned (if we can interpret it as such) */
  803.     ItemRec                         item;
  804. };
  805. typedef struct DETGetCommandItemNBlock    DETGetCommandItemNBlock;
  806.  
  807. struct DETGetDSSpecBlock {
  808.     DETCallBackFunctions             reqFunction;                /* Requested function */
  809.     DETTargetSpecification             target;                        /* The target for the request */
  810.     PackedDSSpecPtr *                dsSpec;                        /* <-  Handle with result (caller must DisposHandle() when done) */
  811.     short                             refNum;                        /* <-  Refnum for address if PD */
  812.     AuthIdentity                     identity;                    /* <-  Identity for address */
  813.     Boolean                         isAlias;                    /* <-  True if this entry is an alias */
  814.     Boolean                         isRecordRef;                /* <-  True if this entry is a record reference (reserved) */
  815. };
  816. typedef struct DETGetDSSpecBlock        DETGetDSSpecBlock;
  817.  
  818. struct DETGetTemplateFSSpecBlock {
  819.     DETCallBackFunctions             reqFunction;                /* Requested function */
  820.     DETTargetSpecification             target;                        /* The target for the request */
  821.     FSSpec                             fsSpec;                        /* <-  FSSpec of template file */
  822.     short                             baseID;                        /* <-  Base ID of this template */
  823.     long                             aspectTemplateNumber;        /* <-  The template number for this aspect template */
  824. };
  825. typedef struct DETGetTemplateFSSpecBlock DETGetTemplateFSSpecBlock;
  826.  
  827. struct DETGetOpenEditBlock {
  828.     DETCallBackFunctions             reqFunction;                /* Requested function */
  829.     DETTargetSpecification             target;                        /* The target for the request */
  830.     short                             viewProperty;                /* <-  The property of the view being edited (or kNoProperty if none) */
  831. };
  832. typedef struct DETGetOpenEditBlock        DETGetOpenEditBlock;
  833.  
  834. struct DETCloseEditBlock {
  835.     DETCallBackFunctions             reqFunction;                /* Requested function */
  836.     DETTargetSpecification             target;                        /* The target for the request */
  837. };
  838. typedef struct DETCloseEditBlock        DETCloseEditBlock;
  839.  
  840. struct DETGetPropertyTypeBlock {
  841.     DETCallBackFunctions             reqFunction;                /* Requested function */
  842.     DETTargetSpecification             target;                        /* The target for the request */
  843.     short                             property;                    /* The property to apply the request to */
  844.     short                             propertyType;                /* <-  The type of the property */
  845. };
  846. typedef struct DETGetPropertyTypeBlock    DETGetPropertyTypeBlock;
  847.  
  848. struct DETGetPropertyNumberBlock {
  849.     DETCallBackFunctions             reqFunction;                /* Requested function */
  850.     DETTargetSpecification             target;                        /* The target for the request */
  851.     short                             property;                    /* The property to apply the request to */
  852.     unsigned long                     propertyValue;                /* <-  The value of the property */
  853. };
  854. typedef struct DETGetPropertyNumberBlock DETGetPropertyNumberBlock;
  855.  
  856. struct DETGetPropertyRStringBlock {
  857.     DETCallBackFunctions             reqFunction;                /* Requested function */
  858.     DETTargetSpecification             target;                        /* The target for the request */
  859.     short                             property;                    /* The property to apply the request to */
  860.     RStringHandle                     propertyValue;                /* <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) */
  861. };
  862. typedef struct DETGetPropertyRStringBlock DETGetPropertyRStringBlock;
  863.  
  864. struct DETGetPropertyBinarySizeBlock {
  865.     DETCallBackFunctions             reqFunction;                /* Requested function */
  866.     DETTargetSpecification             target;                        /* The target for the request */
  867.     short                             property;                    /* The property to apply the request to */
  868.     long                             propertyBinarySize;            /* <-  The size of the property as a binary block */
  869. };
  870. typedef struct DETGetPropertyBinarySizeBlock DETGetPropertyBinarySizeBlock;
  871.  
  872. struct DETGetPropertyBinaryBlock {
  873.     DETCallBackFunctions             reqFunction;                /* Requested function */
  874.     DETTargetSpecification             target;                        /* The target for the request */
  875.     short                             property;                    /* The property to apply the request to */
  876.     Handle                             propertyValue;                /* <-  Handle with the value of the property (caller must DisposHandle() when done) */
  877. };
  878. typedef struct DETGetPropertyBinaryBlock DETGetPropertyBinaryBlock;
  879.  
  880. struct DETGetPropertyChangedBlock {
  881.     DETCallBackFunctions             reqFunction;                /* Requested function */
  882.     DETTargetSpecification             target;                        /* The target for the request */
  883.     short                             property;                    /* The property to apply the request to */
  884.     Boolean                         propertyChanged;            /* <-  True if the property is marked as changed */
  885.     Boolean                         filler1;
  886. };
  887. typedef struct DETGetPropertyChangedBlock DETGetPropertyChangedBlock;
  888.  
  889. struct DETGetPropertyEditableBlock {
  890.     DETCallBackFunctions             reqFunction;                /* Requested function */
  891.     DETTargetSpecification             target;                        /* The target for the request */
  892.     short                             property;                    /* The property to apply the request to */
  893.     Boolean                         propertyEditable;            /* <-  True if the property can be edited by the user (if false, view will appear disabled) */
  894.     Boolean                         filler1;
  895. };
  896. typedef struct DETGetPropertyEditableBlock DETGetPropertyEditableBlock;
  897.  
  898. struct DETSetPropertyTypeBlock {
  899.     DETCallBackFunctions             reqFunction;                /* Requested function */
  900.     DETTargetSpecification             target;                        /* The target for the request */
  901.     short                             property;                    /* The property to apply the request to */
  902.     short                             newType;                    /*  -> New type for property (just sets type, does not convert contents) */
  903. };
  904. typedef struct DETSetPropertyTypeBlock    DETSetPropertyTypeBlock;
  905.  
  906. struct DETSetPropertyNumberBlock {
  907.     DETCallBackFunctions             reqFunction;                /* Requested function */
  908.     DETTargetSpecification             target;                        /* The target for the request */
  909.     short                             property;                    /* The property to apply the request to */
  910.     unsigned long                     newValue;                    /*  -> New value to set property to (and set type to number) */
  911. };
  912. typedef struct DETSetPropertyNumberBlock DETSetPropertyNumberBlock;
  913.  
  914. struct DETSetPropertyRStringBlock {
  915.     DETCallBackFunctions             reqFunction;                /* Requested function */
  916.     DETTargetSpecification             target;                        /* The target for the request */
  917.     short                             property;                    /* The property to apply the request to */
  918.     RStringPtr                         newValue;                    /*  -> New value to set property to (and set type to RString) */
  919. };
  920. typedef struct DETSetPropertyRStringBlock DETSetPropertyRStringBlock;
  921.  
  922. struct DETSetPropertyBinaryBlock {
  923.     DETCallBackFunctions             reqFunction;                /* Requested function */
  924.     DETTargetSpecification             target;                        /* The target for the request */
  925.     short                             property;                    /* The property to apply the request to */
  926.     void *                            newValue;                    /*  -> New value to set property to (and set type to binary) */
  927.     long                             newValueSize;                /*  -> Size of new value */
  928. };
  929. typedef struct DETSetPropertyBinaryBlock DETSetPropertyBinaryBlock;
  930.  
  931. struct DETSetPropertyChangedBlock {
  932.     DETCallBackFunctions             reqFunction;                /* Requested function */
  933.     DETTargetSpecification             target;                        /* The target for the request */
  934.     short                             property;                    /* The property to apply the request to */
  935.     Boolean                         propertyChanged;            /*  -> Value to set changed flag on property to */
  936.     Boolean                         filler1;
  937. };
  938. typedef struct DETSetPropertyChangedBlock DETSetPropertyChangedBlock;
  939.  
  940. struct DETSetPropertyEditableBlock {
  941.     DETCallBackFunctions             reqFunction;                /* Requested function */
  942.     DETTargetSpecification             target;                        /* The target for the request */
  943.     short                             property;                    /* The property to apply the request to */
  944.     Boolean                         propertyEditable;            /*  -> Value to set editable flag on property to */
  945.     Boolean                         filler1;
  946. };
  947. typedef struct DETSetPropertyEditableBlock DETSetPropertyEditableBlock;
  948.  
  949. struct DETDirtyPropertyBlock {
  950.     DETCallBackFunctions             reqFunction;                /* Requested function */
  951.     DETTargetSpecification             target;                        /* The target for the request */
  952.     short                             property;                    /* The property to apply the request to */
  953. };
  954. typedef struct DETDirtyPropertyBlock    DETDirtyPropertyBlock;
  955.  
  956. struct DETDoPropertyCommandBlock {
  957.     DETCallBackFunctions             reqFunction;                /* Requested function */
  958.     DETTargetSpecification             target;                        /* The target for the request */
  959.     short                             property;                    /* The property to apply the request to */
  960.     long                             parameter;                    /* ->  Parameter of command */
  961. };
  962. typedef struct DETDoPropertyCommandBlock DETDoPropertyCommandBlock;
  963.  
  964. struct DETSublistCountBlock {
  965.     DETCallBackFunctions             reqFunction;                /* Requested function */
  966.     DETTargetSpecification             target;                        /* The target for the request */
  967.     long                             count;                        /* <-  The number of items in the current item's sublist */
  968. };
  969. typedef struct DETSublistCountBlock        DETSublistCountBlock;
  970.  
  971. struct DETSelectedSublistCountBlock {
  972.     DETCallBackFunctions             reqFunction;                /* Requested function */
  973.     DETTargetSpecification             target;                        /* The target for the request */
  974.     long                             count;                        /* <-  The number of selected items in the current item's sublist */
  975. };
  976. typedef struct DETSelectedSublistCountBlock DETSelectedSublistCountBlock;
  977.  
  978. struct DETRequestSyncBlock {
  979.     DETCallBackFunctions             reqFunction;                /* Requested function */
  980.     DETTargetSpecification             target;                        /* The target for the request */
  981. };
  982. typedef struct DETRequestSyncBlock        DETRequestSyncBlock;
  983.  
  984. struct DETAddMenuBlock {
  985.     DETCallBackFunctions             reqFunction;                /* Requested function */
  986.     DETTargetSpecification             target;                        /* The target for the request */
  987.     short                             property;                    /* The property to apply the request to */
  988.     RString *                        name;                        /*  -> Name of new menu item */
  989.     long                             parameter;                    /*  -> Parameter to return when this item is selected */
  990.     long                             addAfter;                    /*  -> Parameter of entry to add after, or -1 for add at end */
  991. };
  992. typedef struct DETAddMenuBlock            DETAddMenuBlock;
  993.  
  994. struct DETRemoveMenuBlock {
  995.     DETCallBackFunctions             reqFunction;                /* Requested function */
  996.     DETTargetSpecification             target;                        /* The target for the request */
  997.     short                             property;                    /* The property to apply the request to */
  998.     long                             itemToRemove;                /*  -> Parameter of menu item to remove */
  999. };
  1000. typedef struct DETRemoveMenuBlock        DETRemoveMenuBlock;
  1001.  
  1002. struct DETMenuItemRStringBlock {
  1003.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1004.     DETTargetSpecification             target;                        /* The target for the request */
  1005.     short                             property;                    /* The property to apply the request to */
  1006.     long                             itemParameter;                /*  -> Parameter of menu item to return string for */
  1007.     RStringHandle                     rString;                    /* <-  Handle with the RString (caller must DisposHandle() when done) */
  1008. };
  1009. typedef struct DETMenuItemRStringBlock    DETMenuItemRStringBlock;
  1010.  
  1011. struct DETOpenDSSpecBlock {
  1012.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1013.     PackedDSSpecPtr                 dsSpec;                        /*  -> DSSpec of object to be opened */
  1014. };
  1015. typedef struct DETOpenDSSpecBlock        DETOpenDSSpecBlock;
  1016.  
  1017. struct DETAboutToTalkBlock {
  1018.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1019. };
  1020. typedef struct DETAboutToTalkBlock        DETAboutToTalkBlock;
  1021.  
  1022. struct DETBreakAttributeBlock {
  1023.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1024.     DETTargetSpecification             target;                        /* The target for the request */
  1025.     AttributePtr                     breakAttribute;                /*  -> Attribute to parse */
  1026.     Boolean                         isChangeable;                /*  -> True if the value can be changed by the user */
  1027.     Boolean                         filler1;
  1028. };
  1029. typedef struct DETBreakAttributeBlock    DETBreakAttributeBlock;
  1030.  
  1031. struct DETSavePropertyBlock {
  1032.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1033.     DETTargetSpecification             target;                        /* The target for the request */
  1034.     short                             property;                    /* The property to apply the request to */
  1035. };
  1036. typedef struct DETSavePropertyBlock        DETSavePropertyBlock;
  1037.  
  1038. struct DETGetCustomViewUserReferenceBlock {
  1039.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1040.     DETTargetSpecification             target;                        /* The target for the request */
  1041.     short                             property;                    /* The property to apply the request to */
  1042.     short                             userReference;                /* <-  User reference value, as specified in the .r file */
  1043. };
  1044. typedef struct DETGetCustomViewUserReferenceBlock DETGetCustomViewUserReferenceBlock;
  1045.  
  1046. struct DETGetCustomViewBoundsBlock {
  1047.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1048.     DETTargetSpecification             target;                        /* The target for the request */
  1049.     short                             property;                    /* The property to apply the request to */
  1050.     Rect                             bounds;                        /* <-  Bounds of the view */
  1051. };
  1052. typedef struct DETGetCustomViewBoundsBlock DETGetCustomViewBoundsBlock;
  1053.  
  1054. struct DETGetResourceBlock {
  1055.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1056.     DETTargetSpecification             target;                        /* The target for the request */
  1057.     short                             property;                    /* The property to apply the request to */
  1058.     ResType                         resourceType;                /*  -> Resource type */
  1059.     Handle                             theResource;                /* <-  The resource handle (caller must dispose when done) */
  1060. };
  1061. typedef struct DETGetResourceBlock        DETGetResourceBlock;
  1062.  
  1063. struct DETTemplateCounts {
  1064.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1065.     long                             aspectTemplateCount;        /* <-  Number of aspect templates in the system */
  1066.     long                             infoPageTemplateCount;        /* <-  Number of info-page templates in the system */
  1067. };
  1068. typedef struct DETTemplateCounts        DETTemplateCounts;
  1069.  
  1070. struct DETUnloadTemplatesBlock {
  1071.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1072. };
  1073. typedef struct DETUnloadTemplatesBlock    DETUnloadTemplatesBlock;
  1074.  
  1075.  
  1076. union DETCallBackBlock {
  1077.     DETProtoCallBackBlock             protoCallBack;
  1078.     DETBeepBlock                     beep;
  1079.     DETBusyBlock                     busy;
  1080.     DETChangeCallForsBlock             changeCallFors;
  1081.     DETGetCommandSelectionCountBlock  getCommandSelectionCount;
  1082.     DETGetCommandItemNBlock         getCommandItemN;
  1083.     DETGetDSSpecBlock                 getDSSpec;
  1084.     DETGetTemplateFSSpecBlock         getTemplateFSSpec;
  1085.     DETGetOpenEditBlock             getOpenEdit;
  1086.     DETCloseEditBlock                 closeEdit;
  1087.     DETGetPropertyTypeBlock         getPropertyType;
  1088.     DETGetPropertyNumberBlock         getPropertyNumber;
  1089.     DETGetPropertyRStringBlock         getPropertyRString;
  1090.     DETGetPropertyBinarySizeBlock     getPropertyBinarySize;
  1091.     DETGetPropertyBinaryBlock         getPropertyBinary;
  1092.     DETGetPropertyChangedBlock         getPropertyChanged;
  1093.     DETGetPropertyEditableBlock     getPropertyEditable;
  1094.     DETSetPropertyTypeBlock         setPropertyType;
  1095.     DETSetPropertyNumberBlock         setPropertyNumber;
  1096.     DETSetPropertyRStringBlock         setPropertyRString;
  1097.     DETSetPropertyBinaryBlock         setPropertyBinary;
  1098.     DETSetPropertyChangedBlock         setPropertyChanged;
  1099.     DETSetPropertyEditableBlock     setPropertyEditable;
  1100.     DETDirtyPropertyBlock             dirtyProperty;
  1101.     DETDoPropertyCommandBlock         doPropertyCommand;
  1102.     DETSublistCountBlock             sublistCount;
  1103.     DETSelectedSublistCountBlock     selectedSublistCount;
  1104.     DETRequestSyncBlock             requestSync;
  1105.     DETAddMenuBlock                 addMenu;
  1106.     DETRemoveMenuBlock                 removeMenu;
  1107.     DETMenuItemRStringBlock         menuItemRString;
  1108.     DETOpenDSSpecBlock                 openDSSpec;
  1109.     DETAboutToTalkBlock             aboutToTalk;
  1110.     DETBreakAttributeBlock             breakAttribute;
  1111.     DETSavePropertyBlock             saveProperty;
  1112.     DETGetCustomViewUserReferenceBlock  getCustomViewUserReference;
  1113.     DETGetCustomViewBoundsBlock     getCustomViewBounds;
  1114.     DETGetResourceBlock             getResource;
  1115.     DETTemplateCounts                 templateCounts;
  1116.     DETUnloadTemplatesBlock         unloadTemplates;
  1117. };
  1118. typedef union DETCallBackBlock            DETCallBackBlock;
  1119. typedef DETCallBackBlock *                DETCallBackBlockPtr;
  1120. typedef union DETCallBlock                 DETCallBlock;
  1121.  
  1122. typedef DETCallBlock *                    DETCallBlockPtr;
  1123. typedef CALLBACK_API( OSErr , DETCallBackProcPtr )(DETCallBlock *callBlockPtr, DETCallBackBlockPtr callBackBlockPtr);
  1124. typedef STACK_UPP_TYPE(DETCallBackProcPtr)                         DETCallBackUPP;
  1125. typedef DETCallBackUPP                     DETCallBack;
  1126.  
  1127. struct DETProtoCallBlock {
  1128.     DETCallFunctions                 reqFunction;                /* Requested function */
  1129.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1130.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1131.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1132.                                                                 /*    common to all invocations of code resource) */
  1133.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1134.                                                                 /*    code resource) */
  1135.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1136.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1137.     Boolean                         filler1;
  1138.     short                             property;                    /* The property number the call refers to */
  1139. };
  1140. typedef struct DETProtoCallBlock        DETProtoCallBlock;
  1141.  
  1142. struct DETInitBlock {
  1143.     DETCallFunctions                 reqFunction;                /* Requested function */
  1144.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1145.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1146.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1147.     long                             newCallFors;                /* <-  New call-for mask */
  1148. };
  1149. typedef struct DETInitBlock                DETInitBlock;
  1150.  
  1151. struct DETExitBlock {
  1152.     DETCallFunctions                 reqFunction;                /* Requested function */
  1153.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1154.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1155.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1156. };
  1157. typedef struct DETExitBlock                DETExitBlock;
  1158.  
  1159. struct DETInstanceInitBlock {
  1160.     DETCallFunctions                 reqFunction;                /* Requested function */
  1161.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1162.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1163.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1164.                                                                 /*    common to all invocations of code resource) */
  1165.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1166.                                                                 /*    code resource) */
  1167.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1168.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1169.     Boolean                         filler1;
  1170. };
  1171. typedef struct DETInstanceInitBlock        DETInstanceInitBlock;
  1172.  
  1173. struct DETInstanceExitBlock {
  1174.     DETCallFunctions                 reqFunction;                /* Requested function */
  1175.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1176.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1177.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1178.                                                                 /*    common to all invocations of code resource) */
  1179.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1180.                                                                 /*    code resource) */
  1181.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1182.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1183.     Boolean                         filler1;
  1184. };
  1185. typedef struct DETInstanceExitBlock        DETInstanceExitBlock;
  1186.  
  1187. struct DETInstanceIdleBlock {
  1188.     DETCallFunctions                 reqFunction;                /* Requested function */
  1189.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1190.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1191.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1192.                                                                 /*    common to all invocations of code resource) */
  1193.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1194.                                                                 /*    code resource) */
  1195.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1196.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1197.     Boolean                         filler1;
  1198. };
  1199. typedef struct DETInstanceIdleBlock        DETInstanceIdleBlock;
  1200.  
  1201. struct DETPropertyCommandBlock {
  1202.     DETCallFunctions                 reqFunction;                /* Requested function */
  1203.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1204.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1205.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1206.                                                                 /*    common to all invocations of code resource) */
  1207.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1208.                                                                 /*    code resource) */
  1209.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1210.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1211.     Boolean                         filler1;
  1212.     short                             property;                    /* The property number the call refers to */
  1213.     long                             parameter;                    /*  -> Parameter of command */
  1214. };
  1215. typedef struct DETPropertyCommandBlock    DETPropertyCommandBlock;
  1216.  
  1217. struct DETMaximumTextLengthBlock {
  1218.     DETCallFunctions                 reqFunction;                /* Requested function */
  1219.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1220.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1221.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1222.                                                                 /*    common to all invocations of code resource) */
  1223.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1224.                                                                 /*    code resource) */
  1225.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1226.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1227.     Boolean                         filler1;
  1228.     short                             property;                    /* The property number the call refers to */
  1229.     long                             maxSize;                    /* <-  Return the maximum number of characters the user can entry when property is edited in an EditText */
  1230. };
  1231. typedef struct DETMaximumTextLengthBlock DETMaximumTextLengthBlock;
  1232.  
  1233. struct DETViewListChangedBlock {
  1234.     DETCallFunctions                 reqFunction;                /* Requested function */
  1235.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1236.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1237.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1238.                                                                 /*    common to all invocations of code resource) */
  1239.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1240.                                                                 /*    code resource) */
  1241.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1242.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1243.     Boolean                         filler1;
  1244. };
  1245. typedef struct DETViewListChangedBlock    DETViewListChangedBlock;
  1246.  
  1247. struct DETPropertyDirtiedBlock {
  1248.     DETCallFunctions                 reqFunction;                /* Requested function */
  1249.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1250.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1251.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1252.                                                                 /*    common to all invocations of code resource) */
  1253.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1254.                                                                 /*    code resource) */
  1255.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1256.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1257.     Boolean                         filler1;
  1258.     short                             property;                    /* The property number the call refers to */
  1259. };
  1260. typedef struct DETPropertyDirtiedBlock    DETPropertyDirtiedBlock;
  1261.  
  1262. struct DETValidateSaveBlock {
  1263.     DETCallFunctions                 reqFunction;                /* Requested function */
  1264.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1265.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1266.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1267.                                                                 /*    common to all invocations of code resource) */
  1268.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1269.                                                                 /*    code resource) */
  1270.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1271.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1272.     Boolean                         filler1;
  1273.     RStringHandle                     errorString;                /* <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) */
  1274. };
  1275. typedef struct DETValidateSaveBlock        DETValidateSaveBlock;
  1276.  
  1277. struct DETDropQueryBlock {
  1278.     DETCallFunctions                 reqFunction;                /* Requested function */
  1279.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1280.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1281.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1282.                                                                 /*    common to all invocations of code resource) */
  1283.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1284.                                                                 /*    code resource) */
  1285.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1286.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1287.     Boolean                         filler1;
  1288.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1289.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1290.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1291.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1292.     Boolean                         filler2;
  1293. };
  1294. typedef struct DETDropQueryBlock        DETDropQueryBlock;
  1295.  
  1296. struct DETDropMeQueryBlock {
  1297.     DETCallFunctions                 reqFunction;                /* Requested function */
  1298.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1299.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1300.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1301.                                                                 /*    common to all invocations of code resource) */
  1302.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1303.                                                                 /*    code resource) */
  1304.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1305.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1306.     Boolean                         filler1;
  1307.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1308.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1309.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1310.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1311.     Boolean                         filler2;
  1312. };
  1313. typedef struct DETDropMeQueryBlock        DETDropMeQueryBlock;
  1314.  
  1315. struct DETAttributeCreationBlock {
  1316.     DETCallFunctions                 reqFunction;                /* Requested function */
  1317.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1318.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1319.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1320.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1321.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1322.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1323.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1324.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1325.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1326. };
  1327. typedef struct DETAttributeCreationBlock DETAttributeCreationBlock;
  1328.  
  1329. struct DETAttributeNewBlock {
  1330.     DETCallFunctions                 reqFunction;                /* Requested function */
  1331.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1332.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1333.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1334.                                                                 /*    common to all invocations of code resource) */
  1335.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1336.                                                                 /*    code resource) */
  1337.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1338.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1339.     Boolean                         filler1;
  1340.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1341.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1342.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1343.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1344.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1345.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1346. };
  1347. typedef struct DETAttributeNewBlock        DETAttributeNewBlock;
  1348.  
  1349. struct DETAttributeChangeBlock {
  1350.     DETCallFunctions                 reqFunction;                /* Requested function */
  1351.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1352.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1353.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1354.                                                                 /*    common to all invocations of code resource) */
  1355.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1356.                                                                 /*    code resource) */
  1357.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1358.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1359.     Boolean                         filler1;
  1360.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1361.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1362.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1363.     AttributeType                     attrType;                    /* <-> The type of the attribute being changed */
  1364.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being changed */
  1365.     AttributeCreationID             attrCID;                    /* <-> The CID of the attribute being changed */
  1366.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1367. };
  1368. typedef struct DETAttributeChangeBlock    DETAttributeChangeBlock;
  1369.  
  1370. struct DETAttributeDeleteBlock {
  1371.     DETCallFunctions                 reqFunction;                /* Requested function */
  1372.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1373.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1374.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1375.                                                                 /*    common to all invocations of code resource) */
  1376.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1377.                                                                 /*    code resource) */
  1378.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1379.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1380.     Boolean                         filler1;
  1381.     PackedDSSpecPtr                 dsSpec;                        /*  -> The object which will be deleted */
  1382.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1383.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as */
  1384. };
  1385. typedef struct DETAttributeDeleteBlock    DETAttributeDeleteBlock;
  1386.  
  1387. struct DETItemNewBlock {
  1388.     DETCallFunctions                 reqFunction;                /* Requested function */
  1389.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1390.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1391.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1392.                                                                 /*    common to all invocations of code resource) */
  1393.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1394.                                                                 /*    code resource) */
  1395.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1396.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1397.     Boolean                         filler1;
  1398. };
  1399. typedef struct DETItemNewBlock            DETItemNewBlock;
  1400.  
  1401. struct DETShouldSyncBlock {
  1402.     DETCallFunctions                 reqFunction;                /* Requested function */
  1403.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1404.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1405.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1406.                                                                 /*    common to all invocations of code resource) */
  1407.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1408.                                                                 /*    code resource) */
  1409.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1410.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1411.     Boolean                         filler1;
  1412.     Boolean                         shouldSync;                    /* <-  True if we should now sync with catalog */
  1413.     Boolean                         filler2;
  1414. };
  1415. typedef struct DETShouldSyncBlock        DETShouldSyncBlock;
  1416.  
  1417. struct DETDoSyncBlock {
  1418.     DETCallFunctions                 reqFunction;                /* Requested function */
  1419.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1420.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1421.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1422.                                                                 /*    common to all invocations of code resource) */
  1423.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1424.                                                                 /*    code resource) */
  1425.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1426.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1427.     Boolean                         filler1;
  1428. };
  1429. typedef struct DETDoSyncBlock            DETDoSyncBlock;
  1430.  
  1431. struct DETPatternInBlock {
  1432.     DETCallFunctions                 reqFunction;                /* Requested function */
  1433.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1434.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1435.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1436.                                                                 /*    common to all invocations of code resource) */
  1437.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1438.                                                                 /*    code resource) */
  1439.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1440.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1441.     Boolean                         filler1;
  1442.     short                             property;                    /* The property number the call refers to */
  1443.     long                             elementType;                /*  -> Element type from pattern */
  1444.     long                             extra;                        /*  -> Extra field from pattern */
  1445.     AttributePtr                     attribute;                    /*  -> The complete attribute */
  1446.     long                             dataOffset;                    /* <-> Offset to current (next) byte */
  1447.     short                             bitOffset;                    /* <-> Bit offset (next bit is *fData >> fBitOffset++) */
  1448. };
  1449. typedef struct DETPatternInBlock        DETPatternInBlock;
  1450.  
  1451. struct DETPatternOutBlock {
  1452.     DETCallFunctions                 reqFunction;                /* Requested function */
  1453.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1454.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1455.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1456.                                                                 /*    common to all invocations of code resource) */
  1457.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1458.                                                                 /*    code resource) */
  1459.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1460.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1461.     Boolean                         filler1;
  1462.     short                             property;                    /* The property number the call refers to */
  1463.     long                             elementType;                /*  -> Element type from pattern */
  1464.     long                             extra;                        /*  -> Extra field from pattern */
  1465.     AttributePtr                     attribute;                    /*  -> The attribute (minus the data portion) */
  1466.     Handle                             data;                        /*  -> Data to be written (pre-allocated, resize and add at end) */
  1467.     long                             dataOffset;                    /* <-> Offset to next byte to write */
  1468.     short                             bitOffset;                    /* <-> Bit offset (if zero, handle will need to be resized to one more byte before write) */
  1469. };
  1470. typedef struct DETPatternOutBlock        DETPatternOutBlock;
  1471.  
  1472. struct DETOpenSelfBlock {
  1473.     DETCallFunctions                 reqFunction;                /* Requested function */
  1474.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1475.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1476.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1477.                                                                 /*    common to all invocations of code resource) */
  1478.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1479.                                                                 /*    code resource) */
  1480.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1481.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1482.     Boolean                         filler1;
  1483.     short                             modifiers;                    /*  -> Modifiers at open time (option/control/command/shift keys) */
  1484. };
  1485. typedef struct DETOpenSelfBlock            DETOpenSelfBlock;
  1486.  
  1487. struct DETConvertToNumberBlock {
  1488.     DETCallFunctions                 reqFunction;                /* Requested function */
  1489.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1490.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1491.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1492.                                                                 /*    common to all invocations of code resource) */
  1493.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1494.                                                                 /*    code resource) */
  1495.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1496.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1497.     Boolean                         filler1;
  1498.     short                             property;                    /* The property number the call refers to */
  1499.     long                             theValue;                    /* <-  The converted value to return */
  1500. };
  1501. typedef struct DETConvertToNumberBlock    DETConvertToNumberBlock;
  1502.  
  1503. struct DETConvertToRStringBlock {
  1504.     DETCallFunctions                 reqFunction;                /* Requested function */
  1505.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1506.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1507.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1508.                                                                 /*    common to all invocations of code resource) */
  1509.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1510.                                                                 /*    code resource) */
  1511.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1512.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1513.     Boolean                         filler1;
  1514.     short                             property;                    /* The property number the call refers to */
  1515.     RStringHandle                     theValue;                    /* <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) */
  1516. };
  1517. typedef struct DETConvertToRStringBlock    DETConvertToRStringBlock;
  1518.  
  1519. struct DETConvertFromNumberBlock {
  1520.     DETCallFunctions                 reqFunction;                /* Requested function */
  1521.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1522.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1523.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1524.                                                                 /*    common to all invocations of code resource) */
  1525.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1526.                                                                 /*    code resource) */
  1527.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1528.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1529.     Boolean                         filler1;
  1530.     short                             property;                    /* The property number the call refers to */
  1531.     long                             theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1532. };
  1533. typedef struct DETConvertFromNumberBlock DETConvertFromNumberBlock;
  1534.  
  1535. struct DETConvertFromRStringBlock {
  1536.     DETCallFunctions                 reqFunction;                /* Requested function */
  1537.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1538.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1539.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1540.                                                                 /*    common to all invocations of code resource) */
  1541.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1542.                                                                 /*    code resource) */
  1543.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1544.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1545.     Boolean                         filler1;
  1546.     short                             property;                    /* The property number the call refers to */
  1547.     RStringPtr                         theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1548. };
  1549. typedef struct DETConvertFromRStringBlock DETConvertFromRStringBlock;
  1550.  
  1551. struct DETCustomViewDrawBlock {
  1552.     DETCallFunctions                 reqFunction;                /* Requested function */
  1553.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1554.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1555.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1556.                                                                 /*    common to all invocations of code resource) */
  1557.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1558.                                                                 /*    code resource) */
  1559.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1560.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1561.     Boolean                         filler1;
  1562.     short                             property;                    /* The property number the call refers to */
  1563. };
  1564. typedef struct DETCustomViewDrawBlock    DETCustomViewDrawBlock;
  1565.  
  1566. struct DETCustomViewMouseDownBlock {
  1567.     DETCallFunctions                 reqFunction;                /* Requested function */
  1568.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1569.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1570.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1571.                                                                 /*    common to all invocations of code resource) */
  1572.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1573.                                                                 /*    code resource) */
  1574.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1575.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1576.     Boolean                         filler1;
  1577.     short                             property;                    /* The property number the call refers to */
  1578.     EventRecord *                    theEvent;                    /*  -> The original event record of the mouse-down */
  1579. };
  1580. typedef struct DETCustomViewMouseDownBlock DETCustomViewMouseDownBlock;
  1581.  
  1582. struct DETKeyPressBlock {
  1583.     DETCallFunctions                 reqFunction;                /* Requested function */
  1584.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1585.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1586.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1587.                                                                 /*    common to all invocations of code resource) */
  1588.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1589.                                                                 /*    code resource) */
  1590.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1591.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1592.     Boolean                         filler1;
  1593.     short                             property;                    /* The property number the call refers to */
  1594.     EventRecord *                    theEvent;                    /*  -> The original event record of the key-press */
  1595. };
  1596. typedef struct DETKeyPressBlock            DETKeyPressBlock;
  1597.  
  1598. struct DETPasteBlock {
  1599.     DETCallFunctions                 reqFunction;                /* Requested function */
  1600.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1601.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1602.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1603.                                                                 /*    common to all invocations of code resource) */
  1604.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1605.                                                                 /*    code resource) */
  1606.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1607.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1608.     Boolean                         filler1;
  1609.     short                             property;                    /* The property number the call refers to */
  1610.     short                             modifiers;                    /*  -> Modifiers at paste time (option/control/command/shift keys) */
  1611. };
  1612. typedef struct DETPasteBlock            DETPasteBlock;
  1613.  
  1614. struct DETCustomMenuSelectedBlock {
  1615.     DETCallFunctions                 reqFunction;                /* Requested function */
  1616.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1617.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1618.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1619.                                                                 /*    common to all invocations of code resource) */
  1620.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1621.                                                                 /*    code resource) */
  1622.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1623.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1624.     Boolean                         filler1;
  1625.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1626. };
  1627. typedef struct DETCustomMenuSelectedBlock DETCustomMenuSelectedBlock;
  1628.  
  1629. struct DETCustomMenuEnabledBlock {
  1630.     DETCallFunctions                 reqFunction;                /* Requested function */
  1631.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1632.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1633.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1634.                                                                 /*    common to all invocations of code resource) */
  1635.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1636.                                                                 /*    code resource) */
  1637.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1638.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1639.     Boolean                         filler1;
  1640.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1641.     Boolean                         enable;                        /* <-  Whether to enable the menu item */
  1642.     Boolean                         filler2;
  1643. };
  1644. typedef struct DETCustomMenuEnabledBlock DETCustomMenuEnabledBlock;
  1645.  
  1646. struct DETForwarderListItem {
  1647.     struct DETForwarderListItem **    next;                        /* Pointer to next item, or nil */
  1648.     AttributeTag                     attributeValueTag;            /* Tag of new templates (0 for none) */
  1649.     PackedPathName                     rstrs;                        /* Record type (empty if none), attrbute type (empty if none),list of template names to forward to */
  1650. };
  1651. typedef struct DETForwarderListItem        DETForwarderListItem;
  1652.  
  1653. typedef DETForwarderListItem *            DETForwarderListPtr;
  1654. typedef DETForwarderListPtr *            DETForwarderListHandle;
  1655.  
  1656. struct DETDynamicForwardersBlock {
  1657.     DETCallFunctions                 reqFunction;                /* Requested function */
  1658.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1659.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1660.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1661.     DETForwarderListHandle             forwarders;                    /* <-  List of forwaders */
  1662. };
  1663. typedef struct DETDynamicForwardersBlock DETDynamicForwardersBlock;
  1664.  
  1665. struct DETDynamicResourceBlock {
  1666.     DETCallFunctions                 reqFunction;                /* Requested function */
  1667.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1668.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1669.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1670.                                                                 /*    common to all invocations of code resource) */
  1671.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1672.                                                                 /*    code resource) */
  1673.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1674.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1675.     Boolean                         filler1;
  1676.     ResType                         resourceType;                /*  -> The resource type being requested */
  1677.     short                             propertyNumber;                /*  -> The property number of the resource being requested */
  1678.     short                             resourceID;                    /*  -> The resource ID (base ID + property number) of the resource */
  1679.     Handle                             theResource;                /* <-  The requested resource */
  1680. };
  1681. typedef struct DETDynamicResourceBlock    DETDynamicResourceBlock;
  1682.  
  1683.  
  1684. union DETCallBlock {
  1685.     DETProtoCallBlock                 protoCall;
  1686.     DETInitBlock                     init;
  1687.     DETExitBlock                     exit;
  1688.     DETInstanceInitBlock             instanceInit;
  1689.     DETInstanceExitBlock             instanceExit;
  1690.     DETInstanceIdleBlock             instanceIdle;
  1691.     DETPropertyCommandBlock         propertyCommand;
  1692.     DETMaximumTextLengthBlock         maximumTextLength;
  1693.     DETViewListChangedBlock         viewListChanged;
  1694.     DETPropertyDirtiedBlock         propertyDirtied;
  1695.     DETValidateSaveBlock             validateSave;
  1696.     DETDropQueryBlock                 dropQuery;
  1697.     DETDropMeQueryBlock             dropMeQuery;
  1698.     DETAttributeCreationBlock         attributeCreationBlock;
  1699.     DETAttributeNewBlock             attributeNew;
  1700.     DETAttributeChangeBlock         attributeChange;
  1701.     DETAttributeDeleteBlock         attributeDelete;
  1702.     DETItemNewBlock                 itemNew;
  1703.     DETPatternInBlock                 patternIn;
  1704.     DETPatternOutBlock                 patternOut;
  1705.     DETShouldSyncBlock                 shouldSync;
  1706.     DETDoSyncBlock                     doSync;
  1707.     DETOpenSelfBlock                 openSelf;
  1708.     DETConvertToNumberBlock         convertToNumber;
  1709.     DETConvertToRStringBlock         convertToRString;
  1710.     DETConvertFromNumberBlock         convertFromNumber;
  1711.     DETConvertFromRStringBlock         convertFromRString;
  1712.     DETCustomViewDrawBlock             customViewDraw;
  1713.     DETCustomViewMouseDownBlock     customViewMouseDown;
  1714.     DETKeyPressBlock                 keyPress;
  1715.     DETPasteBlock                     paste;
  1716.     DETCustomMenuSelectedBlock         customMenuSelected;
  1717.     DETCustomMenuEnabledBlock         customMenuEnabled;
  1718.     DETDynamicForwardersBlock         dynamicForwarders;
  1719.     DETDynamicResourceBlock         dynamicResource;
  1720. };
  1721.  
  1722. #if OPAQUE_UPP_TYPES
  1723.     EXTERN_API(DETCallBackUPP)
  1724.     NewDETCallBackUPP               (DETCallBackProcPtr        userRoutine);
  1725.  
  1726.     EXTERN_API(void)
  1727.     DisposeDETCallBackUPP           (DETCallBackUPP            userUPP);
  1728.  
  1729.     EXTERN_API(OSErr)
  1730.     InvokeDETCallBackUPP           (DETCallBlock *            callBlockPtr,
  1731.                                     DETCallBackBlockPtr        callBackBlockPtr,
  1732.                                     DETCallBackUPP            userUPP);
  1733.  
  1734. #else
  1735.     enum { uppDETCallBackProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  1736.     #define NewDETCallBackUPP(userRoutine)                             (DETCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallBackProcInfo, GetCurrentArchitecture())
  1737.     #define DisposeDETCallBackUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  1738.     #define InvokeDETCallBackUPP(callBlockPtr, callBackBlockPtr, userUPP)  (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppDETCallBackProcInfo, (callBlockPtr), (callBackBlockPtr))
  1739. #endif
  1740. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1741. #define NewDETCallBackProc(userRoutine)                         NewDETCallBackUPP(userRoutine)
  1742. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr) InvokeDETCallBackUPP(callBlockPtr, callBackBlockPtr, userRoutine)
  1743. /* Call-for list: */
  1744. enum {
  1745.     kDETCallForOther            = 1,                            /* Call for things not listed below (also auto-enabled by DE if any of the below are enabled) */
  1746.     kDETCallForIdle                = 2,                            /* kDETcmdIdle */
  1747.     kDETCallForCommands            = 4,                            /* kDETcmdPropertyCommand, kDETcmdSelfOpen */
  1748.     kDETCallForViewChanges        = 8,                            /* kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength */
  1749.     kDETCallForDrops            = 0x10,                            /* kDETcmdDropQuery, kDETcmdDropMeQuery */
  1750.     kDETCallForAttributes        = 0x20,                            /* kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete */
  1751.     kDETCallForValidation        = 0x40,                            /* kDETcmdValidateSave */
  1752.     kDETCallForKeyPresses        = 0x80,                            /* kDETcmdKeyPress and kDETcmdPaste */
  1753.     kDETCallForResources        = 0x0100,                        /* kDETcmdDynamicResource */
  1754.     kDETCallForSyncing            = 0x0200,                        /* kDETcmdShouldSync, kDETcmdDoSync */
  1755.     kDETCallForEscalation        = 0x8000,                        /* All calls escalated from the next lower level */
  1756.     kDETCallForNothing            = 0,                            /* None of the above */
  1757.     kDETCallForEverything        = (long)0xFFFFFFFF                /* All of the above */
  1758. };
  1759.  
  1760. typedef CALLBACK_API( OSErr , DETCallProcPtr )(DETCallBlockPtr callBlockPtr);
  1761. typedef STACK_UPP_TYPE(DETCallProcPtr)                             DETCallUPP;
  1762. #if OPAQUE_UPP_TYPES
  1763.     EXTERN_API(DETCallUPP)
  1764.     NewDETCallUPP                   (DETCallProcPtr            userRoutine);
  1765.  
  1766.     EXTERN_API(void)
  1767.     DisposeDETCallUPP               (DETCallUPP                userUPP);
  1768.  
  1769.     EXTERN_API(OSErr)
  1770.     InvokeDETCallUPP               (DETCallBlockPtr            callBlockPtr,
  1771.                                     DETCallUPP                userUPP);
  1772.  
  1773. #else
  1774.     enum { uppDETCallProcInfo = 0x000000E0 };                         /* pascal 2_bytes Func(4_bytes) */
  1775.     #define NewDETCallUPP(userRoutine)                                 (DETCallUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallProcInfo, GetCurrentArchitecture())
  1776.     #define DisposeDETCallUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  1777.     #define InvokeDETCallUPP(callBlockPtr, userUPP)                 (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppDETCallProcInfo, (callBlockPtr))
  1778. #endif
  1779. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1780. #define NewDETCallProc(userRoutine)                             NewDETCallUPP(userRoutine)
  1781. #define CallDETCallProc(userRoutine, callBlockPtr)                InvokeDETCallUPP(callBlockPtr, userRoutine)
  1782.  
  1783. typedef DETCallUPP                         DETCall;
  1784. /* This following macro saves you from having to dig out the call-back pointer from the call block: */
  1785. #define CallBackDET(callBlockPtr, callBackBlockPtr) CallDETCallBackProc(callBlockPtr->protoCall.callBack,callBlockPtr,callBackBlockPtr)
  1786. #endif /* REZ */
  1787.  
  1788. /************************************************************************************/
  1789. /********************************* SAM Definitions: *********************************/
  1790. /************************************************************************************/
  1791.  
  1792. /* SAM Developers should use property numbers starting at this point: */
  1793. #define kSAMFirstDevProperty                kDETFirstDevProperty + 10
  1794.  
  1795.  
  1796. /*
  1797.     SAM templates have additional resources/properties that are required
  1798.     for interaction with the AOCE Key Chain.
  1799.     
  1800.      Type    Offset                        Description
  1801.      ----    ------                        -----------
  1802.     'rstr'    kSAMAspectUserName            The user name
  1803.     'rstr'    kSAMAspectKind                The kind of SAM
  1804.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1805.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1806. */
  1807.  
  1808. #define kSAMAspectUserName                        kDETFirstDevProperty + 1
  1809. #define kSAMAspectKind                            kDETFirstDevProperty + 2
  1810. #define kSAMAspectCannotDelete                    kDETFirstDevProperty + 3
  1811. #define kSAMAspectSlotCreationInfo                kDETFirstDevProperty + 4
  1812.  
  1813. /**************************************************************************************
  1814.  ********************************* Admin Definitions: *********************************
  1815.  **************************************************************************************/
  1816.  
  1817. #define kDETAdminVersion         -978
  1818.  
  1819.  
  1820.  
  1821.  
  1822. #ifndef REZ
  1823.  
  1824. #endif /* REZ */
  1825.  
  1826. #if PRAGMA_STRUCT_ALIGN
  1827.     #pragma options align=reset
  1828. #elif PRAGMA_STRUCT_PACKPUSH
  1829.     #pragma pack(pop)
  1830. #elif PRAGMA_STRUCT_PACK
  1831.     #pragma pack()
  1832. #endif
  1833.  
  1834. #ifdef PRAGMA_IMPORT_OFF
  1835. #pragma import off
  1836. #elif PRAGMA_IMPORT
  1837. #pragma import reset
  1838. #endif
  1839.  
  1840. #ifdef __cplusplus
  1841. }
  1842. #endif
  1843.  
  1844. #endif /* __OCETEMPLATES__ */
  1845.  
  1846.